cmake_minimum_required(VERSION 3.12)

project(GroupDemo)

include(cmake/SourceGroup.cmake)

# 添加可执行文件1
set(TARGET_NAME ${PROJECT_NAME})
add_executable(${TARGET_NAME} test.cpp)
#set_property(TARGET ${PROJECT_NAME} PROPERTY FOLDER "SolutionDir")

file(GLOB_RECURSE CPPSOURCES "*.cpp" "*.cxx" "*.h")
add_source_group("main" TREE ${CMAKE_SOURCE_DIR} FILES ${CPPSOURCES})

add_subdirectory(src)

apply_source_group()

# 添加可执行文件2
set(TARGET_NAME ${PROJECT_NAME}_1)
add_executable(${TARGET_NAME} test.cpp)

file(GLOB_RECURSE CPPSOURCES "*.cpp" "*.cxx" "*.h")
add_source_group("main" TARGET ${TARGET_NAME} TREE ${CMAKE_SOURCE_DIR} FILES ${CPPSOURCES})

add_subdirectory(src1)

apply_source_group(${TARGET_NAME})
